
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Atoms &#8212; atomman 1.4.0 documentation</title>
    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Box" href="atomman.Box.html" />
    <link rel="prev" title="plot" href="atomman.plot.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="atomman.Box.html" title="Box"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="atomman.plot.html" title="plot"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="atomman.html" accesskey="U">atomman package</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="atoms">
<h1>Atoms<a class="headerlink" href="#atoms" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="atomman.Atoms">
<em class="property">class </em><code class="sig-prename descclassname">atomman.</code><code class="sig-name descname">Atoms</code><span class="sig-paren">(</span><em class="sig-param">natoms=None</em>, <em class="sig-param">atype=None</em>, <em class="sig-param">pos=None</em>, <em class="sig-param">prop=None</em>, <em class="sig-param">model=None</em>, <em class="sig-param">safecopy=False</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Class for representing a collection of atoms.</p>
<dl class="class">
<dt id="atomman.Atoms.PropertyDict">
<em class="property">class </em><code class="sig-name descname">PropertyDict</code><span class="sig-paren">(</span><em class="sig-param">host</em><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms.PropertyDict" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/collections.html#collections.OrderedDict" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">collections.OrderedDict</span></code></a></p>
<p>Extends OrderedDict to work with Atoms</p>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.atypes">
<em class="property">property </em><code class="sig-name descname">atypes</code><a class="headerlink" href="#atomman.Atoms.atypes" title="Permalink to this definition">¶</a></dt>
<dd><p>List of int atom types.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)">tuple</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.df">
<code class="sig-name descname">df</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms.df" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a pandas.DataFrame of all atomic properties.  Multi-dimensional
per-atom data will be converted into multiple table columns.</p>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Allows additional atoms to be added to the end of the atoms list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>value</strong> (<a class="reference internal" href="#atomman.Atoms" title="atomman.Atoms"><em>atomman.Atoms</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – An int value will result in the atoms object being extended by
that number of atoms, with all per-atom properties having default
values (atype = 1, everything else = 0).  For an Atoms value, the
current atoms list will be extended by the correct number of atoms
and all per-atom properties in value will be copied over.  Any
properties defined in one Atoms object and not the other will be
set to default values.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A new Atoms object containing all atoms and properties of the
current object plus the additional atoms.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#atomman.Atoms" title="atomman.Atoms">atomman.Atoms</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.model">
<code class="sig-name descname">model</code><span class="sig-paren">(</span><em class="sig-param">prop_name=None</em>, <em class="sig-param">unit=None</em>, <em class="sig-param">prop_unit=None</em><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms.model" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates a data model for the Atoms object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>prop_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a><em>, </em><em>optional</em>) – The Atoms properties to include.  If neither prop_name nor prop_unit
are given, all system properties will be included.</p></li>
<li><p><strong>unit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a><em>, </em><em>optional</em>) – Lists the units for each prop_name as stored in the table.  For a
value of None, no conversion will be performed for that property.
If neither unit nor prop_units given, pos will be
given in Angstroms and all other values will not be converted.</p></li>
<li><p><strong>prop_unit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)"><em>dict</em></a><em>, </em><em>optional</em>) – dictionary where the keys are the property keys to include, and
the values are units to use. If neither unit nor prop_units given,
pos will be given in Angstroms and all other values will not be
converted.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A JSON/XML data model for the current Atoms object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>DataModelDict.DataModelDict</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.natoms">
<em class="property">property </em><code class="sig-name descname">natoms</code><a class="headerlink" href="#atomman.Atoms.natoms" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of atoms in the Atoms class.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.natypes">
<em class="property">property </em><code class="sig-name descname">natypes</code><a class="headerlink" href="#atomman.Atoms.natypes" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of atom types in the Atoms class.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.prop">
<code class="sig-name descname">prop</code><span class="sig-paren">(</span><em class="sig-param">key=None</em>, <em class="sig-param">index=None</em>, <em class="sig-param">value=None</em>, <em class="sig-param">a_id=None</em><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms.prop" title="Permalink to this definition">¶</a></dt>
<dd><p>Accesses the per-atom properties for controlled getting and setting.
For getting values, prop() always returns a copy of the underlying
data as opposed to the data itself.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – Per-atom property name.</p></li>
<li><p><strong>index</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#slice" title="(in Python v3.9)"><em>slice</em></a><em>, </em><em>optional</em>) – Index of atoms.</p></li>
<li><p><strong>value</strong> (<em>any</em><em>, </em><em>optional</em>) – Property values to assign.</p></li>
<li><p><strong>a_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – Integer atom index.  Left in for backwards compatibility.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><ul class="simple">
<li><p><em>list</em> – If no parameters given, returns a list of all assigned property
keys.</p></li>
<li><p><em>atomman.Atoms</em> – If index or a_id is given without value or key, returns a new
Atoms instance for the specified atom indices.</p></li>
<li><p><em>numpy.ndarray</em> – If key (and index/a_id) is given without value, returns a copy of
the data associated with that property key.</p></li>
</ul>
</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.9)"><strong>ValueError</strong></a> – If a_id and index are both given, or only value is given.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.prop_atype">
<code class="sig-name descname">prop_atype</code><span class="sig-paren">(</span><em class="sig-param">key</em>, <em class="sig-param">value</em>, <em class="sig-param">atype=None</em><span class="sig-paren">)</span><a class="headerlink" href="#atomman.Atoms.prop_atype" title="Permalink to this definition">¶</a></dt>
<dd><p>Allows for per-atom properties to be assigned according to
Atoms.atypes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Per-atom property name.</p></li>
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a><em>, </em><em>any</em>) – Property value(s) to assign.  If atype is not given, this should be
an object of length Atoms.natypes. Otherwise, should be a single per-atom
value.</p></li>
<li><p><strong>atype</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – A specific atype to assign value to.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.9)"><strong>ValueError</strong></a> – If length of value does not match Atoms.natypes or atype is not in
    Atoms.atypes.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="atomman.Atoms.view">
<em class="property">property </em><code class="sig-name descname">view</code><a class="headerlink" href="#atomman.Atoms.view" title="Permalink to this definition">¶</a></dt>
<dd><p>All assigned per-atom properties.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#atomman.Atoms.PropertyDict" title="atomman.Atoms.PropertyDict">PropertyDict</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="atomman.plot.html"
                        title="previous chapter">plot</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="atomman.Box.html"
                        title="next chapter">Box</a></p>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="atomman.Box.html" title="Box"
             >next</a> |</li>
        <li class="right" >
          <a href="atomman.plot.html" title="plot"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="atomman.html" >atomman package</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
    </div>
  </body>
</html>